package com.tentact.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.tentact.vo.Employee;

import tk.mybatis.mapper.common.Mapper;

public interface EmployeeMapper extends Mapper<Employee> {
	//根据员工的状态查询员工的方法
	@Select("select * from employee where EmployeeStatus = #{status}")
	List<Employee> selectByStatus(@Param("status")Integer employeeStatus);
	//根据用户名和密码查询用户的方法  如果该方法不用到动态sql  可以通过注解来实现该方法功能  不需要去mapper映射文件去写实现功能
	@Select("select * from employee where username = #{username} and userpwd = #{pwd} and EmployeeStatus = 1")
	Employee selectByNameAndPwd(@Param("username")String username,@Param("pwd")String pwd);
	//查询总记录数
	int selectCountPage(@Param("employee")Employee employee);
	//按条件分页
	List<Employee> selectByPage(@Param("employee")Employee employee,@Param("page")PageUtil page);
	
	@Select("select * from employee where departmentid = #{deptno} ")
	List<Employee> selectByDeptno(Integer deptno);
	
}
